<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<head>
<%@include file="/include.jsp"%>
<link href="${ctx}/css/style.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/table.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/dwz/themes/default/style.css" rel="stylesheet"
	type="text/css" media="screen" />
<link href="${ctx}/dwz/themes/css/core.css" rel="stylesheet"
	type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="dtreeck.css">
<SCRIPT language="Javascript" type="text/javascript" src="dtreeck.js"></SCRIPT>
<SCRIPT language="Javascript" type="text/javascript" src="jquery.js"></SCRIPT>
</head>

<body topmargin="0" leftmargin="0">
	<table border="0" cellpadding="0" cellspacing="0" class="table_border">
		<tr>
			<td>
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					class="table_right">
					<tr>
						<td><font style="font-size: 12px;"><strong>添加员工</strong></font>
						</td>
						<td width="25" height="26"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" class="table_right">
					<tr>
						<td>
							<table width="100%" border="0" cellspacing="0"
								class="table_padding">
								<tr>
									<td align="center">
										<table border="0" cellpadding="0" cellspacing="0"
											class="box_table" id="box_table2">
											<thead>
												<tr>
													<td class="box_table_even"><span class="in">姓名：</span></td>
													<td class="box_table_odd"><span class="in"> <input
															type="text" name="name"/> <span class="star">*</span>
													</span></td>
												</tr>
												<tr>
													<td class="box_table_even"><span class="in">年龄：</span></td>
													<td class="box_table_odd"><span class="in"> <input
															type="text" name="age"/> <span class="star">*</span>
													</span></td>
												</tr>
												<tr>
													<td class="box_table_even">性别：</td>
													<td class="box_table_odd"><span class="in"> <input
															type="radio" value="1" name="sex" checked="checked">男
															<input type="radio" value="0" name="sex">女 <span
															class="star">*</span>
													</span></td>
												</tr>
												<tr>
													<td class="box_table_even"><span class="in">身份证号：</span></td>
													<td class="box_table_odd"><span class="in"> <input
															type="text" name="zhengjian" />
															<span class="star">*</span>
													</span></td>
												</tr>
												<tr>
													<td width="20%" align="right">部门：</td>
													<td width="30%" align="left"><input type="text"
														id="menu_parent_name"  readonly="readonly" style="width: 150px;"> <input
														type="hidden" id="menu_parent" name="menu_parent">
													<!-- 父菜单id --> <input type="hidden" id="oprate"
														name="oprate"  readonly="readonly">
													<!-- radio --> <input type="hidden" id="menu_id"
														name="menu_id"  readonly="readonly">
													<!-- 父菜单id --></td>
													<!-- <td width="20%" align="right"></td>
													<td width="30%" align="left"></td> -->
													<div id="treediv"
														style="display: none; position: absolute; overflow: scroll; width: 150px; height: 200px; padding: 5px; background: #fff; color: #fff; border: 1px solid #cccccc">
														<div align="right">
															<a href="##" id="closed"><font color="blue">关闭&nbsp;</font></a>
														</div>
														<script language="JavaScript" type="text/JavaScript">
				//树代码
				mydtree = new dTree('mydtree','imgmenu/','no','no');
				mydtree.add(0,
					  -1,
					  "逸天教育科技有限公司",
					  "javascript:setvalue('0','逸天教育科技有限公司')",
					  "根目录",
					  "_self",
					  false);
				
				mydtree.add(11,
				0,
				'管理部',
				"javascript:setvalue('11','管理部')",
				'管理部',
				'_self',
				false);
				
				mydtree.add(12,
				0,
				'讲师部',
				"javascript:setvalue('12','讲师部')",
				'讲师部',
				'_self',
				false);
				
				mydtree.add(13,
				0,
				'学管部',
				"javascript:setvalue('13','学管部')",
				'学管部',
				'_self',
				false);
				
				mydtree.add(14,
				0,
				'招生部',
				"javascript:setvalue('14','招生部')",
				'招生部',
				'_self',
				false);
				
				mydtree.add(15,
				0,
				'后勤部',
				"javascript:setvalue('15','后勤部')",
				'后勤部',
				'_self',
				false);
				
				mydtree.add(16,
				0,
				'财务部',
				"javascript:setvalue('16','财务部')",
				'财务部',
				'_self',
				false);
				
			   document.write(mydtree);
			   
			</script>
													</div>
												</tr>
												<tr>
													<td class="box_table_even"><span class="in">职务：</span></td>
													<td class="box_table_odd"><span class="in"> <select
															name="bumen">
																<option value="0" selected="selected">请选择</option>
																<option value="1">后勤部长</option>
																<option value="2">财务部长</option>
																<option value="3">管理部长</option>
																<option value="4">讲师部长</option>
																<option value="5">学管部长</option>
																<option value="6">招生部长</option>
														</select> <span class="star">*</span>
													</span></td>
												</tr>
											</thead>
											<tbody>
											</tbody>
										</table>
									</td>
								</tr>
							</table>
							<table border="0" cellpadding="0" cellspacing="0"
								class="operation">
								<thead>
									<tr>
										<td height="24">&nbsp;</td>
									</tr>
								</thead>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table  width="100%" border="0" cellpadding="0" cellspacing="0"
					class="table_padding">
					<tr>
						<td height="15px" align="center" >
							<table>
								<tr>
									<td width="150px" ><a class="button" href="list.jsp">
										<span>保存</span></a>
									</td>
									<td width="150px"><a class="button"
										href="javascript:void(window.history.back());"><span>返回</span></a>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<script type="text/javascript">
//生成弹出层的代码
<!-- 弹出层-->
xOffset = 0;//向右偏移量
yOffset = 25;//向下偏移量
var toshow = "treediv";//要显示的层的id
var target = "menu_parent_name";//目标控件----也就是想要点击后弹出树形菜单的那个控件id
$("#"+target).click(function (){
	$("#"+toshow)
	.css("position", "absolute")
	.css("left", $("#"+target).position().left+xOffset + "px")
	.css("top", $("#"+target).position().top+yOffset +"px").show();
});
//关闭层
$("#closed").click(function(){
	$("#"+toshow).hide();
});
//判断鼠标在不在弹出层范围内
 /* function   checkIn(id){
	var yy = 20;   //偏移量
	var str = "";
	var   x=window.event.clientX;   
	var   y=window.event.clientY;   
	var   obj=$("#"+id)[0];
	if(x>obj.offsetLeft&&x<(obj.offsetLeft+obj.clientWidth)&&y>(obj.offsetTop-yy)&&y<(obj.offsetTop+obj.clientHeight)){   
		return true;
	}else{   
		return false;
	}   
  }    */
//点击body关闭弹出层
	/* $(document).click(function(){
		var is = checkIn("treediv");
		if(!is){
			$("#"+toshow).hide();
		}
	}); */
<!-- 弹出层-->
//生成弹出层的代码
//点击菜单树给文本框赋值------------------菜单树里加此方法
function setvalue(id,name){
	$("#menu_parent_name").val(name);
	$("#menu_parent").val(id);
	$("#treediv").hide();
}

</script>
</body>

</html>
